﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;

namespace KDService
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        static void Main()
        {
            if (Debugger.IsAttached)
            {
                new KDWorkService().DoWork();

                while (true)
                {
                    Console.Read();
                    System.Threading.Thread.Sleep(10);
                }
            }
            else
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
                {
                   new KDWorkService()
                };
                ServiceBase.Run(ServicesToRun);
            }
        }
    }
}
